export default function BroswerFinger() {
    let cavs = document.createElement("canvas")
    cavs.width = 200
    cavs.height = 200
    let cxt = cavs.getContext("2d")
    cxt?.beginPath()
    cxt?.arc(100, 100, 30, 0, Math.PI * 2)
    cxt?.stroke()
    let b64 = cavs.toDataURL().replace("data:image/png;base64,", "");
    var bin = window.atob(b64);
    var crc = bin2hex(bin.slice(-16, -12));
    console.log('浏览器指纹', crc);
}
function bin2hex(s: string) {
    var i, l, o = "", n;
    s += "";

    for (i = 0, l = s.length; i < l; i++) {
        n = s.charCodeAt(i).toString(16);
        o += n.length < 2 ? "0" + n : n;
    }
    return o;
}